<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<title>表单验证－支持自定义函数校验</title>
<link href="../../../../themes/default/ui.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../../../theme_cookie.js"></script>
<script src="../../../../scripts/jquery.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="../tipsy.css" />
<script src="../jquery.tipsy.js" type="text/javascript"></script>
<script src="../jquery.validationConfig.js" type="text/javascript"></script>
<script src="../jquery.validation.js" type="text/javascript"></script>
<script>
	$(document).ready(function() {
		$("#personForm").validation()
	});
</script>
</head>
<body>
<form id="personForm" action="#">
<!-- 表单信息 -->
<table width="100%" cellpadding="0" cellspacing="1" border="0" id="tbody_1" style="border: 1px solid #A8CFEB">
	<tr>
		<th>姓名：</th>
		<td>
			<input type="text" id="name" validator="required,length[6,10]" />
		</td>
		<th>性别：</th>
		<td>
			<input id="contractType1" name="contractType" type="radio" validator="required" />男&nbsp;&nbsp; 
			<input id="contractType2" name="contractType" type="radio" validator="required" />女
		</td>
	</tr>
	<tr>
		<th>年龄：</th>
		<td>
			<input type="text" id="agreement" validator="pattern[integer],range[1,100]" />
		</td>
		<th>籍贯：</th>
		<td>
			<select id="city" validator="required">
				<option></option>
				<option>北京</option>
				<option>河北</option>
				<option>上海</option>
				<option>天津</option>
				<option>广东</option>
				<option>湖北</option>
				<option>湖南</option>
				<option>广西</option>
				<option>四川</option>
				<option>重庆</option>
			</select>
		</td>
	</tr>
	<tr>
		<th>出生日期：</th>
		<td>
			<input type="text" id="birthday" validator="date[生日输入格式应该为YYYY-MM-DD]" />
		</td>
		<th>电子邮件：</th>
		<td>
			<input type="text" id="email" validator="required,pattern[email]" />
		</td>
	</tr>
	<tr>
		<th>密码：</th>
		<td>
			<input type="password" id="password" validator="equalToField[repassword,密码必须与确认密码一致]" />
		</td>
		<th>密码(确认)：</th>
		<td>
			<input type="password" id="repassword" validator="equalToField[password,密码必须与确认密码一致]" />
		</td>
	</tr>
	<tr>
		<th>兴趣爱好：</th>
		<td colspan="3">
			<input type="checkbox" name="interest" validator="range[2,4]" id="interest1">篮球</input> 
			<input type="checkbox" name="interest" validator="range[2,4]" id="interest2">爬山</input> 
			<input type="checkbox" name="interest" validator="range[2,4]" id="interest2">听歌</input> 
			<input type="checkbox" name="interest" validator="range[2,4]" id="interest2">读书</input> 
			<input type="checkbox" name="interest" validator="range[2,4]" id="interest2">旅游</input> 
			<input type="checkbox" name="interest" validator="range[2,4]" id="interest2">象棋</input> 
			<input type="checkbox" name="interest" validator="range[2,4]" id="interest2">围棋</input> 
			<input type="checkbox" name="interest" validator="range[2,4]" id="interest2">游戏</input>
		</td>
	</tr>
	<tr>
		<th>备注：</th>
		<td colspan="3">
			<textarea id="remark" validator="required"></textarea>
		</td>
	</tr>
</table>
	<input type="submit" value="提交"/>
</form>
</body>
</html>